/******************************************************************************
 ***************************** Contract.java **********************************
 * @author Scott DiTomaso******************************************************
 * Kettering University *******************************************************
 ******************************************************************************
 * Created on January 02, 2010 ************************************************
 ******************************************************************************/

package openbridge;

/******************
 * Contract class *
 ******************/
public class Contract {

    /*************************
     * Private class members *
     *************************/
	private String Winner;
	private String condition;
	private int tricks;
	private int trump;

        /***************
         * Constructor *
         ***************/
	Contract() {

	    Winner = "None";
	    condition = "None";
	    tricks = 0;
	    trump = 0;
	}


    /************************
     * Public class members *
     ************************/

	/**********************************************************************
	 * setContract() ******************************************************
	 **********************************************************************
	 * Sets the values of the contract to the values supplied *************
	 **********************************************************************/
	public void setContract(String w, int t, int suit, String c) {

	    this.Winner = w;
	    this.condition = c;
	    this.tricks = t;
	    this.trump = suit;
	}

	/**********************************************************************
	 * getWinner() ********************************************************
	 **********************************************************************
	 * Returns the position of the final person to bid as a String ********
	 **********************************************************************/
	public String getWinner() {

	    return this.Winner;
	}

	/**********************************************************************
	 * getSuit() **********************************************************
	 **********************************************************************
	 * Returns any conditions such as double or redouble that are *********
	 * associated with the contract ***************************************
	 **********************************************************************/
	public String getConditions() {

	    return this.condition;
	}

	/**********************************************************************
	 * getTricks() ********************************************************
	 **********************************************************************
	 * Returns the number of tricks the winner bid as an Int **************
	 **********************************************************************/
	public int getTricks() {

	    return this.tricks;
	}
	/**********************************************************************
	 * getTrump() *********************************************************
	 **********************************************************************
	 * Returns the trump suit of the contarct as an Int *******************
	 **********************************************************************/
	public int getTrump() {

	    return this.trump;
	}

	/**********************************************************************
	 * isFianl() **********************************************************
	 **********************************************************************
	 * Returns false if the Winner field has not been set and true if *****
	 * the field is anything but the default "None" ***********************
	 **********************************************************************/
	public boolean isFinal() {

	    if(this.Winner == "None")
		return false;
	    else
		return true;
	}

}
